package com.goodboys.dao;

import com.goodboys.entity.InformationBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by CJ on 2018-06-11.
 */


public interface InformationDao {

    //插入数据
    @Insert("insert into information(user_name,content,create_time) values(#{user_name,jdbcType=VARCHAR},#{content},#{create_time})")
    Integer addInfo(InformationBean informationBean);

    //查询数据
    @Select("select content from information where user_name = #{user_name,jdbcType=VARCHAR} order by create_time DESC")
    List<String> getInfos(@Param("user_name") String userName);


}
